SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

create procedure dbo.DnnProduct_GetSiteLog9

@PortalID int,
@PortalAlias nvarchar(50),
@StartDate datetime,
@EndDate datetime

as

select 'Page' = dbo.DnnProduct_Tabs.TabName,
 'Requests' = count(*),
 'LastRequest' = max(DateTime)
from dbo.DnnProduct_SiteLog
inner join dbo.DnnProduct_Tabs on dbo.DnnProduct_SiteLog.TabId = dbo.DnnProduct_Tabs.TabId
where dbo.DnnProduct_SiteLog.PortalId = @PortalID
and dbo.DnnProduct_SiteLog.DateTime between @StartDate and @EndDate
and dbo.DnnProduct_SiteLog.TabId is not null
group by dbo.DnnProduct_Tabs.TabName
order by Requests desc









GO
